package com.stone.elec.rename.executor;

import java.util.HashMap;
import java.util.Map;

import com.stone.elec.rename.executor.impl.DbExecutor;
import com.stone.elec.rename.executor.impl.ProjectDirExecutor;
import com.stone.elec.rename.executor.impl.ProjectExecutor;
import com.stone.elec.rename.executor.impl.RootExecutor;

public class ExecutorFactory {

	private static final Map<String, BaseExecutor> executorMap = new HashMap<String, BaseExecutor>();

	public static void put(String key, BaseExecutor executor) {
		executorMap.put(key, executor);
	}

	private  static void putAll(){
	//	RootExecutor.put();
		DbExecutor.put();
		ProjectDirExecutor.put();
	}

	public static void execute() {
		putAll();
		executorMap.entrySet().stream().forEach(v -> {
			v.getValue().execute();
		});
	}
}
